<?php

// 是否存在 1订了 2没有
function dr_is_tag_favdingtie($id, $uid = 0) {

    !$uid && $uid = \Phpcmf\Service::C()->uid;

    if ($id && $uid){
		$rt = \Phpcmf\Service::M()->db->table(SITE_ID.'_'.MOD_DIR.'_dingtie')->where('uid', $uid)->where('cid', $id)->countAllResults();
		//SITE_ID.'_'.MOD_DIR.'_form_son'
		//$rt = $this->db->table($tablename.'1_quanzi_cart')->where('cid', $id)->where('uid', $id)->countAllResults();
	  //$rt = \Phpcmf\Service::M()->db->table(SITE_ID.'_tag_favorite')->where('uid', $uid)->where('cid', $id)->countAllResults();
	    if ($rt){
	    	return '<div class="yishou buhuanhang">
			<div class="wenzijuzhong beijing-touming-2 yuanjiao-50 gaokuan-16">
			<i class="bi bi-at ziti-10"></i> 
			</div>
			<div class="wenzijuzhong pull-right shang-2 zuo-5">已订</div>
			</div>';
	    }else{
			return '<div class="weishou buhuanhang">
			        <div class="wenzijuzhong beijing-touming yuanjiao-50 gaokuan-16">
			        <i class="bi bi-plus wenzibaise ziti-10"></i> 
					</div>
					<div class="wenzijuzhong pull-right shang-2 zuo-5">
			            订帖
					</div>
			        </div>';
		}
    } 
    

}
function dr_is_tag_favorite($id, $uid = 0) {

    !$uid && $uid = \Phpcmf\Service::C()->uid;

    if ($id && $uid){
		$rt = \Phpcmf\Service::M()->db->table(SITE_ID.'_'.MOD_DIR.'_favorite')->where('uid', $uid)->where('cid', $id)->countAllResults();
		//SITE_ID.'_'.MOD_DIR.'_form_son'
		//$rt = $this->db->table($tablename.'1_quanzi_cart')->where('cid', $id)->where('uid', $id)->countAllResults();
	  //$rt = \Phpcmf\Service::M()->db->table(SITE_ID.'_tag_favorite')->where('uid', $uid)->where('cid', $id)->countAllResults();
	    if ($rt){
	    	return '<div class="yishou buhuanhang">
			<div class="wenzijuzhong beijing-touming-2 yuanjiao-50 gaokuan-16">
			<i class="bi bi-at ziti-10"></i> 
			</div>
			<div class="wenzijuzhong pull-right shang-2 zuo-5">已订</div>
			</div>';
	    }else{
			return '<div class="weishou buhuanhang">
			        <div class="wenzijuzhong beijing-touming yuanjiao-50 gaokuan-16">
			        <i class="bi bi-plus wenzibaise ziti-10"></i> 
					</div>
					<div class="wenzijuzhong pull-right shang-2 zuo-5">
			            订帖
					</div>
			        </div>';
		}
    } 
    

}
